<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function giao(m,n) {
            var b = m
        var a = ''
        for (i = n-1 ;i >= 0 ; i--) {
            a += b[i]
        }
        console.log(a);
        }
        giao([1,2,3,4,5,],5)
    </script>
 </body>
</html>